package Stream;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Test {
    @org.junit.Test
    public void creation(){
        //通过集合创建流
        List<String> list = new ArrayList();
        Stream<String> stream = list.stream();
        //通过静态方法
        Stream<String>stream1=Stream.of("1");
        Stream<String>stream2=Stream.concat(stream,stream1);//合并两个流

        //通过Random随机生成流
        IntStream ints = new Random().ints(6);

    }
}
